package com.xqls.quaz;


import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.Callable;

import com.xqls.dal.model.Company;
import com.xqls.dal.model.CompanyExample;
import com.xqls.dal.service.CompanyMapper;
import com.xqls.thread.ThreadPoolExecutorUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

import com.xqls.dal.model.DeviceSchema;
import com.xqls.dal.model.DeviceSchemaExample;
import com.xqls.dal.service.DeviceSchemaMapper;
import com.xqls.util.ContextUtil;
import com.xqls.util.DictionaryEnums;

public class QtzJob {


    @Value("${deviceSchema}")
    private String deviceSchema;
    private static final Logger LOG = LoggerFactory
            .getLogger(QtzJob.class);
    @Autowired
    CompanyMapper companyMapper;
    public void  execute(){
        List<Company> deviceSchemas=null;
        try{
            CompanyExample example=new CompanyExample();
            List<Integer> values=new ArrayList<Integer>();
            values.add(DictionaryEnums.INTAKE.getCode());
            values.add(DictionaryEnums.DISCHARGE.getCode());
            example.createCriteria().andDeviceTypeIn(values);
            deviceSchemas=   companyMapper.selectByExample(example);
        }catch (Exception e){
            LOG.error("TentNo"+ContextUtil.getTentNo(),e);
        }

        if(deviceSchemas!=null){

            for(Company deviceSchema:deviceSchemas){
                new RecordDumpRunAble( deviceSchema).call();
            }


        }


    }
    
}
